Skip to content

Clean up FeatureExport.copyFileToDirectory()#2628

Open
rovarga wants to merge 1 commit into
apache:mainfrom
rovarga:fe-copy
Open

Clean up FeatureExport.copyFileToDirectory()#2628
rovarga wants to merge 1 commit into
apache:mainfrom
rovarga:fe-copy

Conversation

@rovarga

@rovarga rovarga commented May 2, 2026

Copy link
Copy Markdown
Contributor

Use Files.copy() instead of open-coding the copy operation.

Signed-off-by: Robert Varga robert.varga@pantheon.tech

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies FeatureExport.copyFileToDirectory() in the features command module by replacing a hand-written stream copy loop with Files.copy(). It is a small cleanup in the feature:export-bundles command path, which exports resolved feature bundles into a target directory.

Changes:

  • Replaced manual FileInputStream/FileOutputStream copy logic with Files.copy().
  • Switched destination path construction to Path.resolve(...) and retained the existing "already exported" behavior when the target file already exists.
  • Performed minor Javadoc whitespace cleanup alongside the refactor.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return false;
}

Files.copy(file.toPath(), newFile);
@jbonofre jbonofre self-requested a review May 2, 2026 15:22
Use Files.copy() instead of open-coding the copy operation.

Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants